package com.distribution.system.openapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.distribution.system.openapi.domain.entity.CmccDaDownChannelInfo;
import com.distribution.system.openapi.mapper.CmccDaDownChannelInfoMapper;
import com.distribution.system.openapi.service.CmccDaDownChannelInfoService;
import org.springframework.stereotype.Service;

import javax.validation.constraints.NotNull;

/**
 * @author: GodLu
 * @create: 2024-04-15 15:35
 * @description: TODO
 */
@Service
public class CmccDaDownChannelInfoServiceImpl extends ServiceImpl<CmccDaDownChannelInfoMapper, CmccDaDownChannelInfo> implements CmccDaDownChannelInfoService {

    @Override
    public String getAppSecretByAppId(@NotNull String appid) {
        CmccDaDownChannelInfo one = getOne(new LambdaQueryWrapper<CmccDaDownChannelInfo>().eq(CmccDaDownChannelInfo::getAppId, appid), false);
        return one == null ? null : one.getAppSecret();
    }
}
